<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title></title>
</head>
<body>
	<canvas id="mycanvas" width="500px" height="500px" style="border:1px solid #000000;"></canvas>
</body>
</html>

<script type="text/javascript">
	var c= document.getElementById('mycanvas');
	var ctx = c.getContext('2d');
	ctx.fillStyle = "red";
	ctx.fillRect(10,10,50,50);
	image = new Image();
	image.src = "images/个人logo.jpg";
	image.onload = function(){
		ctx.drawImage(image,10,10,50,50);
		var imgData = ctx.getImageData(10,10,50,50)
		ctx.putImageData(imgData,10,70)
	}
	copy();
	function copy(){
			var imgData = ctx.getImageData(10,10,50,50)
	ctx.putImageData(imgData,10,70)
	}

</script>